package com.thz.friend.controller.user;

import com.thz.common.core.constants.HttpConstants;
import com.thz.common.core.controller.BaseController;
import com.thz.common.core.pojo.TableDataInfo;
import com.thz.common.core.result.Result;
import com.thz.friend.aspect.CheckUserStatus;
import com.thz.friend.pojo.exam.dto.ExamDTO;
import com.thz.friend.pojo.exam.dto.ExamQueryDTO;
import com.thz.friend.service.user.IUserExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Author thz
 * @Date 2025/3/29
 */
@RestController
@RequestMapping("/user/exam")
public class UserExamController extends BaseController {

    @Autowired
    private IUserExamService userExamService;


    @CheckUserStatus
    @PostMapping("/enter")
    public Result enter(@RequestHeader(HttpConstants.AUTHENTICATION) String token, @RequestBody ExamDTO examDTO) {
        return IToResult(userExamService.enter(token, examDTO));
    }

    @GetMapping("/list")
    public TableDataInfo list(ExamQueryDTO examQueryDTO) {
        return userExamService.list(examQueryDTO);
    }

}
